package com.cx.zyx.modulebiz.news.remote.service.user;


import com.cx.zyx.modulebiz.news.remote.model.AdminInfo;
import com.cx.zyx.modulebiz.news.remote.model.Author;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * OpenFeign降级处理,实现对应接口方法
 */
@Component
public class AdminFeignFallback implements AdminFeign {
    @Override
    public ResponseEntity<AdminInfo> getDefaultProfile() {
        AdminInfo adminInfo = new AdminInfo("none", "unknow", "查询降级");
        return ResponseEntity.ok(adminInfo);
    }

    @Override
    public ResponseEntity<Author> getAuthorById(String id) {
        Author author = new Author(id, "none" + id, "test@example.com", "测试描述", new Date(), new Date());
        return ResponseEntity.ok(author);
    }
}
